<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./OL_SDK/include-openlayers-local.js"></script>
    <script src="./libs/gaode.js"></script>
    <script src="./utils/createDraw.js"></script>
    <script src="https://lib.baomitu.com/Turf.js/latest/turf.min.js"></script>
    <script src="/utils/setCanvasStyle.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0
        }

        #map {
            width: 100vw;
            height: 100vh;
        }

        #btn {
            width: 200px;
            height: 50px;
            z-index: 100;
            position: fixed;
            left: 50px;
            top: 11px;
            background-color: #6528e0;
            border: none;
            border-radius: 15px;
            color: #fff;
        }

        #btn:hover {
            cursor: pointer;
            background-color: #6528e0a7;
        }
    </style>
</head>

<body>
    <!-- <button id="btn" onclick="activeDraw()">空间分析</button> -->
    <div id="map">
    </div>
    <script>
        var map = new ol.Map({
            target: "map",
            layers: [gaode],
            view: new ol.View({
                projection: 'EPSG:4326',
                center: [114.30, 30.50],
                zoom: 4
            })
        })
        /* 1、加载geojson数据
        features
         */
        // var btn = document.getElementById("btn");
        var source = new ol.source.Vector({
            format: new ol.format.GeoJSON(),
            url: "/data/query.json"
        })
        var layer = new ol.layer.Vector({
            source
        })
        map.addLayer(layer);
       
        // console.log(source)
    </script>
</body>

</html>